<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ page 
    	import="java.util.ArrayList"
    	import="com.ipartek.fila2.bean.Alumno"
     %>
<!DOCTYPE html>
<html>
	<head>
		<!--<meta http-equiv="Content-Type" content="text/html"; charset="utf-8">-->
		<meta charset="utf-8">
		<link href="css/jquery.dataTables.css" rel="stylesheet" />
		<link href="css/jquery.dataTables_themeroller.css" rel="stylesheet" />
		<link href="themes/smoothness/jquery-ui-1.8.4.custom.css" rel="stylesheet" />
		<link href="css/style.css" rel="stylesheet" />
		<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		<script src="js/jquery.dataTables.js"></script>	
		<title>Ranking de tiradas por alumno</title>
		<script>
			$(document).ready(function() {
				$('#tPuntuaciones').dataTable({
					"bScrollInfinite"	: 	true,
					//"sScrollY"			:	200,
			        "bJQueryUI"			: 	true,
			        //"sPaginationType"	: 	"full_numbers",
			        "iDisplayLength"	: 	300
				});
			} );
		</script>
				
	</head>
	<body>
	<div id="content">
	<h1>Ranking de alumnos</h1>
	<fieldset style="height:500px ">
		<table id="tPuntuaciones">
			<thead>
			<tr>
				<th>Id</th>
				<th>DNI</th>
				<th>Alumno</th>
				<th>Email</th>
				<th>Fecha de alta</th>
				<th>Fecha de baja</th>
				<th>Tiradas</th>
			</tr>
			</thead>
			<tbody>
				<%
					ArrayList<Alumno> alumnos =(ArrayList<Alumno>) request.getAttribute("puntuaciones");
					String nombre;
					for(Alumno alumno : alumnos){
						nombre = alumno.getNombre() +" " +  alumno.getApellido1() +" " + alumno.getApellido2();
						out.print("<tr>");
						out.print("<td>"+ alumno.getId_alumno()  +"</td>");
						out.print("<td>"+ alumno.getDni()  +"</td>");
						out.print("<td>"+ nombre +"</td>");
						out.print("<td>"+ alumno.getEmail()  +"</td>");
						out.print("<td>"+ alumno.getFecha_Alta()  +"</td>");
						out.print("<td>"+ alumno.getFecha_Baja()  +"</td>");
						out.print("<td>"+ alumno.getNum_tiradas()  +"</td>");
						out.print("</tr>");
					}
			%>
			</tbody>
			<tfoot></tfoot>
		</table>
	</fieldset>
		</div><!-- Fin id="content" -->
	</body>
</html>